﻿function getOrders() {
    $.getJSON("api/Order",
        function (data) {            
            $.each(data, function (key, val) {
                var str = val.ID + " , " + val.Name;
                $('.orderList').append("ID: " + val.ID + ", Name: "+ val.Name + "<br>");
            });
        });
};

function getItems() {
    $.getJSON("api/Item",
        function (data) {
            $.each(data, function (key, val) {                
                var str = val.ID + " , " + val.Name;
                $('.itemList').append("TestID: " + val.ID + ", Name: " + val.Name + "<br>");
            });
        });
};

function submitItemQuery() {
    var tempItemQuery = { StoreID: "0" };
    $.post("api/Item", tempItemQuery,
    function (data) {
        $.each(data, function (key, val) {
            //var str = val.ID + " , " + val.Name;
           // alert(str);
           // $('.itemList').append("TestID: " + val.ID + ", Name: " + val.Name + "<br>");
        });        
    });
}

//Store
function getStores() {
    $.getJSON("api/Store",
        function (data) {
            $.each(data, function (key, val) {
                var str = val.Id + " , " + val.Name;
                $('.debug').append("TestID: " + val.Id + ", Name: " + val.Name + "<br>");
            });
        });
};